<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class ShopAttrTkvModel extends Model
{
    //定义一个表名
    protected $table = 'shop_attr_tkv';
    //定义主键
    protected $primaryKey = 'id';

    static function getYxzList($tid){
		$yxzlist = ShopAttrTkvModel::where("shop_attr_tkv.tid",$tid)
			->join("shop_attr_key","shop_attr_tkv.kid","shop_attr_key.id")
			->distinct(true)
			->select("shop_attr_tkv.tid","shop_attr_tkv.kid","shop_attr_key.kname")
			->get();

		return $yxzlist;
	}
}
